﻿using System.ComponentModel.DataAnnotations;

namespace WebApplication2.model
{

    public class BaseModel
    {
        [Required(ErrorMessage = "id不能为空--我是实体里的")]
        [RangeAttribute(1, 10, ErrorMessage = "Value for {0} must be between {1} and {2}.")]
        public int ids { get; set; }
        [Required(ErrorMessage = "name不能为空--我是实体里的")]
        public string name { get; set; }
    }
    public class TestModel1 : BaseModel
    {
        public int name { get; set; }
    }
    public class TestModel2 : BaseModel
    {
        public int age { get; set; }
    }

}
